package com.reny.szkj.ft_login.ui.login

import com.reny.ll.git.base_logic.api.ApiInterface
import com.reny.ll.git.base_logic.api.process
import com.reny.ll.git.base_logic.api.reqMap
import com.reny.ll.git.base_logic.api.toBody
import com.reny.ll.git.base_logic.model.login.LoginInfo

class LoginRepository(val api: ApiInterface) {

    suspend fun login(phone: String, pwd: String): LoginInfo {
        return api.login(reqMap().set("name", phone)
            .set("password", pwd)
            .toBody()).process()!!
        /*return when (val results = response.handler()) {
            is Results.Success -> {
                results
            }
            is Results.Failure -> results
        }*/
    }

}